<template>
  <div style="background-color: var(--themeBaseColor);
    padding: 0;
    margin: 0;
    padding-bottom: 1rem;
    box-sizing: border-box; min-height: 100vh;">
    <c-title :hide="false" text="实时数据"></c-title>
    <div><img src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/plugin/signPage/decoration1.png"
        style="width: 3rem;
    height: 3rem;
    position: relative;
    left: 8rem;
    top: 1.5rem;" alt="" /></div>
    <div
      style="position: relative; text-align: left; color: #333131; font-size: 15px; margin: 16px; padding: 16px; border-radius:10px; background-color: #ffffff;" >
      <div>会员卡销售实时数据</div>
      <div style=" margin-top: 5px; display: flex; flex-direction: column; gap: 5px; ">
        <div style="display: flex;">
          <div style="flex: 1;">本日 单数:{{ syInfo.br_hy_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.br_hy_price }}</div>
        </div>
        <div style="display: flex;">
          <div style="flex: 1;">本月 单数:{{ syInfo.by_hy_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.by_hy_price }}</div>
        </div>
        <div style="display: flex;">
          <div style="flex: 1;">本年 单数:{{ syInfo.bn_hy_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.bn_hy_price }}</div>
        </div>
      </div>
      <div style="height: 1px; background: #333; width: 100%; margin: 5px 0;"></div>
      <div>商品销售实时数据</div>
      <div style=" margin-top: 5px; display: flex; flex-direction: column; gap: 5px; ">
        <div style="display: flex;">
          <div style="flex: 1;">本日 单数:{{ syInfo.br_goods_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.br_goods_price }}</div>
        </div>
        <div style="display: flex;">
          <div style="flex: 1;">本月 单数:{{ syInfo.by_goods_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.by_goods_price }}</div>
        </div>
        <div style="display: flex;">
          <div style="flex: 1;">本年 单数:{{ syInfo.bn_goods_count }}</div>
          <div style="flex: 1;">业绩:{{ syInfo.bn_goods_price }}</div>
        </div>
      </div>
    </div>
  </div>

</template>

<script>
export default {
  data() {
    return {
      syInfo: {}
    }
  },
  mounted() {
    this.getsyInfo();
  },
  methods: {
    getsyInfo() {
      var that = this;
      $http
        .get(
          "member.member.syInfo",
          {},
          ""
        )
        .then(
          function (response) {
            if (response.result == 1) {
              if(response.data.is_qx){
                that.syInfo = response.data
              }else{
                this.$toast('暂无查看权限')
                setTimeout(()=>{
                  that.$router.go(-1)
                },3000)
              }
              
              // console.log(response.data)
            } else {

              // Toast(response.msg)
            }
          },
          function (response) {
            // error callback
          }
        );
    },
  }
}
</script>
